<template>
  <el-dialog title="接待记录详情" :visible.sync="dialogFormVisible">
    <div>
      <table style="width: 100%" class="mytable">
        <tr>
          <td class="ttitle" rowspan="2">咨询人信息</td>
          <td class="ttitle">姓名</td>
          <td>{{detail.consultantName}}</td>
          <td colspan="2"></td>
        </tr>
        <tr>
          <td class="ttitle">联系电话</td><td>{{detail.consultantContactNumber}}</td>

          <td class="ttitle">与老人关系</td><td>{{detail.consultantRelationshipName}}</td>
        </tr>
        <tr>
          <td class="ttitle" rowspan="3">老人信息</td>
          <td class="ttitle">姓名</td><td>{{detail.elderlyName}}</td>
          <td class="ttitle">性别</td><td>{{detail.elderlyGenderName}}</td>
        </tr>
        <tr>
<!--          <td class="ttitle">出生日期</td><td><span v-if="detail.elderlyBirth ">{{ detail.elderlyBirth | parseTime("{y}-{m}-{d}") }}</span></td>-->
          <td class="ttitle">自理情况</td><td colspan="3">{{detail.elderlySelfCareName}}</td>

        </tr>
        <tr>
          <td class="ttitle">住址</td><td>{{detail.elderlyAddress}}</td>
          <td colspan="2"></td>
        </tr>
        <tr>
          <td class="ttitle" rowspan="5">接待信息</td>
          <td class="ttitle" >咨询方式</td><td>{{detail.consultationModeName}}</td>
          <td class="ttitle" >接待状态</td><td>{{detail.receptionStatusName}}</td>
        </tr>
        <tr>
          <td class="ttitle" >媒介渠道</td><td>{{detail.mediaChannelName}}</td>
          <td class="ttitle" >咨询次数</td><td>{{detail.numberOfConsultations}}</td>
        </tr>
        <tr>
          <td class="ttitle" >接待人</td><td>{{detail.receptionistName}}</td>
          <td class="ttitle" >咨询意向</td><td>{{detail.consultationIntentionName}}</td>
        </tr>
        <tr>
          <td class="ttitle" >咨询时间</td><td v-if="detail.consultationTime">{{ detail.consultationTime | parseTime("{y}-{m}-{d} {h}:{i}:{s}") }}</td>
          <td colspan="2"></td>
        </tr>
        <tr>
          <td class="ttitle" >咨询内容</td>
          <td colspan="3">{{detail.consultationContent}}</td>
        </tr>
        <tr>
          <td class="ttitle">时间</td><td class="ttitle" colspan="4">记录内容</td>
        </tr>
        <tr v-for="follow in detail.followUpRecords" :key="follow.code">
          <td class="ttitle" v-if="follow.createTime">{{ follow.createTime | parseTime("{y}-{m}-{d} {h}:{i}:{s}") }}</td>
          <td colspan="4">{{ follow.followUpContent }}</td>
        </tr>

      </table>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="dialogFormVisible = false">关 闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
    import { saveReceptions } from "@/api/reception";
    import {searchUserOfOrgan} from "@/api/user"
    import {findAllDictionaryWithChild} from "@/api/dict"
    import { parseTime} from "@/utils/index";

    export default {
        name: "showAdvisory",
        filters:{
                  parseTime:parseTime
                },
        data() {
            return {
              dialogFormVisible: false,
              detail: {
                "code": undefined,
                "consultantContactNumber": undefined,
                "consultantName": undefined,
                "consultantRelationship": undefined,
                "consultantRelationshipName": undefined,
                "consultationContent": undefined,
                "consultationIntention": undefined,
                "consultationIntentionName": undefined,
                "consultationMode": undefined,
                "consultationModeName": undefined,
                "consultationTime": undefined,
                "createTime": undefined,
                "creator": undefined,
                "creatorName": undefined,
                "del": undefined,
                "elderlyAddress": undefined,
                "elderlyBirth": undefined,
                "elderlyGender": undefined,
                "elderlyGenderName": undefined,
                "elderlyName": undefined,
                "elderlySelfCare": undefined,
                "elderlySelfCareName": undefined,
                "followUpRecords": [
                  {
                    "code": undefined,
                    "consultantName": undefined,
                    "consultationIntention": undefined,
                    "createTime": undefined,
                    "creator": undefined,
                    "elderlyName": undefined,
                    "followUpContent": undefined,
                    "id": undefined,
                    "recordCode": undefined,
                    "version": undefined
                  }
                ],
                "id": undefined,
                "institutionName": undefined,
                "institutionNumber": undefined,
                "lastUpdateTime": undefined,
                "lastUpdator": undefined,
                "lastUpdatorName": undefined,
                "mediaChannel": undefined,
                "mediaChannelName": undefined,
                "numberOfConsultations": undefined,
                "receptionStatus": undefined,
                "receptionStatusName": undefined,
                "receptionist": undefined,
                "receptionistName": undefined,
                "version": undefined
              }
            }
        },
        methods: {
          show(row) {
            this.dialogFormVisible = true
            this.detail = row
          }

        }
    }
</script>

<style scoped>
  table
  {
    border-collapse: collapse;
    margin: 0 auto;
    text-align: center;
  }
  table td, table th
  {
    border: 1px solid #cad9ea;
    height: 30px;
  }
  table .ttitle
  {
    background-color: #F5FAFA;
    width: 100px;
  }
  table tr:nth-child(odd)
  {
    background: #fff;
  }

</style>
